#ifndef BASE_CTF_RULES_H
#define BASE_CTF_RULES_H

#include <utils/Pluginterface.h>
#include <concrete/EventSystem.h>

#include <game/Collisions.h>

//Added events
//----------------------------------
class FlagCaptureEvent : public /*Server?*/Event
{
public:
	//TODO: Fill this in
	
};
//----------------------------------

class FlagResponse : public ResponseTo< EntityCollisionEvent >
{
	
public:
	virtual void respond( const EntityCollisionEvent& event )
	{
		//Entity* pFlag1 = event.getEntity1();
		//Entity* pFlag2 = event.getEntity2();
		
		//if ( pFlag1.state == "home" )
		//	EventManager->raiseEvent(
		//	       FlagCaptureEvent( pFlag1.team, pFlag1.carrier /*, ... */ ) );
		//else if ( pFlag2.state == "home" )
		//	EventManager->raiseEvent(
		//	       FlagCaptureEvent( pFlag2.team, pFlag2.carrier /*, ... */ ) );
		//else {
			//Do nothing (a non-event)
		//}
	}
	
};

class BaseCTFRules : public RuleSet
{
public:
	virtual String getID() const { return "BaseCTFRules"; }
	
	virtual std::list< String > getDependencies() const
	{
		std::list< String > sDependencies;
		
		//sDependancies.push_back( "a required RuleSet name" );
		//sDependancies.push_back( "another required RuleSet name" );
		
		return sDependencies;
	}
	
	virtual void addRulesTo( EventManager* pEventMgr )
	{
		pEventMgr->addRule( EntityCollisionEvent( "flag", "flag" ), FlagResponse );
	}
};

DEFINE_PLUGIN( BaseCTFRules, RuleSet )

#endif //BASE_CTF_RULES_H
